<?php

namespace App\Package\Base;

use GuzzleHttp\Exception\GuzzleException;
use Psr\Http\Message\ResponseInterface;
use Yolo\Components\RpcClient\Annotations\RpcClient;
use Yolo\Components\RpcClient\Client;

class Base
{

    public function __construct(
        #[RpcClient('Base')]
        private readonly Client $client,
    ) {}

    /**
     * 根据id获取用户信息
     * @param array $args
     * @return ResponseInterface
     * @throws GuzzleException
     */
    public function getUserById(array $args): ResponseInterface
    {
        return $this->client->invoke('GetUserById', $args);
    }

    /**
     * 获取用户信息
     * @param array $args
     * @return ResponseInterface
     * @throws GuzzleException
     */
    public function getUserProfile(array $args): ResponseInterface
    {
        return $this->client->invoke('GetUserProfile', $args);
    }

}